package com.tj.test.sys.service.impl;

import com.tj.test.sys.dao.TypeMapper;
import com.tj.test.sys.po.TypeQ;
import com.tj.test.sys.service.ITypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class TypeService implements ITypeService {
    @Autowired
    private TypeMapper mapper;
    @Override
    //查询所有试题类型信息
    public List<TypeQ> selectAllType() {
        List<TypeQ> list=new ArrayList<>();
        if (mapper.selectAllType()!=null)
            list=mapper.selectAllType();
        return list;
    }

    @Override
    //根据id查询试题类型信息
    public TypeQ selectTypeById(int typeid) {
        TypeQ typeQ=new TypeQ();
        //判断查询数据是否为空
        if (mapper.selectTypeById(typeid)!=null){
            typeQ=mapper.selectTypeById(typeid);}
        return typeQ;
    }
}
